import http from "./http.js";

//获取导航
const getNav = () => {
  return http.get("store/show.json");
};

//获取男生人气榜

const getMalePopRank = () => {
  return http.get("/store/rankList.json", {
    rankType: 34,
    uuid: "ca03da7b64ca443ab25ec3b662fa91e2",
    all: 0,
  });
};

//获得男生畅销榜
const getMaleGoodSaleRank = () => {
  return http.get("/store/rankList.json", {
    rankType: 26,
    uuid: "ca03da7b64ca443ab25ec3b662fa91e2",
    all: 0,
  });
};

//获得男生新书榜
const getMaleNewBookRank = () => {
  return http.get("/store/rankList.json", {
    rankType: 800,
    uuid: "ca03da7b64ca443ab25ec3b662fa91e2",
    all: 0,
  });
};
//获得男生免费榜
const getMaleFreeBookRank = () => {
  return http.get("/store/rankList.json", {
    rankType: 804,
    uuid: "ca03da7b64ca443ab25ec3b662fa91e2",
    all: 0,
  });
};
//获得男生完结榜
const getMaleFinishedBookRank = () => {
  return http.get("/store/rankList.json", {
    rankType: 806,
    uuid: "ca03da7b64ca443ab25ec3b662fa91e2",
    all: 0,
  });
};
//获取女生人气榜

const getFemalePopRank = () => {
  return http.get("/store/rankList.json", {
    rankType: 35,
    uuid: "017de2274aa5400e9dabe30f173e98d9",
    all: 0,
  });
};

//获得女生畅销榜
const getFemaleGoodSaleRank = () => {
  return http.get("/store/rankList.json", {
    rankType: 27,
    uuid: "017de2274aa5400e9dabe30f173e98d9",
    all: 0,
  });
};

//获得女生新书榜
const getFemaleNewBookRank = () => {
  return http.get("/store/rankList.json", {
    rankType: 900,
    uuid: "017de2274aa5400e9dabe30f173e98d9",
    all: 0,
  });
};
//获得女生免费榜
const getFemaleFreeBookRank = () => {
  return http.get("/store/rankList.json", {
    rankType: 903,
    uuid: "017de2274aa5400e9dabe30f173e98d9",
    all: 0,
  });
};
//获得女生完结榜
const getFemaleFinishedBookRank = () => {
  return http.get("/store/rankList.json", {
    rankType: 905,
    uuid: "017de2274aa5400e9dabe30f173e98d9",
    all: 0,
  });
};

const searchBook = (key, page = 1) => {
  return http.get2("/search/book", {
    keyword: key,
    sort: "",
    pageNo: page,
    pageNum: 20,
    isFromHuayu: 0,
  });
};

export {
  getNav,
  getMalePopRank,
  getMaleGoodSaleRank,
  getMaleNewBookRank,
  getMaleFreeBookRank,
  getMaleFinishedBookRank,
  getFemalePopRank,
  getFemaleGoodSaleRank,
  getFemaleNewBookRank,
  getFemaleFreeBookRank,
  getFemaleFinishedBookRank,
  searchBook,
};
